<%--
  Created by IntelliJ IDEA.
  User: Think
  Date: 2022/11/5
  Time: 0:07
  To change this template use File | Settings | File Templates.
--%>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.Statement" %>
<%@ page import="java.sql.ResultSet" %>
<%@ page import="java.util.List" %>
<%@ page import="javabean.Pinglun" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>登录投票</title>
</head>
<style>
    body {
        font-family: Arial, sans-serif;
        background-color: #f2f2f2;
    }
    video {
        display: block;
        margin: 0 auto;
        width: 80%;
        max-width: 800px;
        box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
    }
    h1 {
        text-align: center;
        margin-top: 50px;
        color: #333;
    }
    body {
        font-family: Arial, sans-serif;
        background-color: #f2f2f2;
        padding: 20px;
    }
    .comment {
        background-color: #fff;
        border-radius: 5px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        padding: 20px;
        margin-bottom: 20px;
    }
    h3 {
        margin-top: 0;
    }
    p {
        margin-top: 5px;
    }
    input[type="text"], textarea {
        width: 100%;
        padding: 10px;
        margin: 10px 0;
        box-sizing: border-box;
        border: 1px solid #ccc;
        border-radius: 4px;
    }
    input[type="submit"] {
        background-color: #4CAF50;
        color: white;
        padding: 10px 20px;
        border: none;
        border-radius: 4px;
        cursor: pointer;
    }
    input[type="submit"]:hover {
        background-color: #45a049;
    }
</style>
<body>
<h1 style="text-align: left"><%=request.getSession().getAttribute("xm") %>,登录成功！</h1>
<h1>精彩赛事回访：巴西VS德国</h1>
<video controls autoplay poster="poster.jpg">
    <source src="av1.mp4" type="video/mp4">
    Your browser does not support the video tag.
</video>
<h1>精彩赛事回访：法攻VS日本</h1>
<video controls autoplay poster="poster.jpg">
    <source src="av1.mp4" type="video/mp4">
    Your browser does not support the video tag.
</video>
<%
    List<Pinglun> pinglunList = (List<Pinglun>) request.getSession().getAttribute("pinglunList");
    if (pinglunList != null) {
        for (Pinglun p : pinglunList) {
            // 在这里对每个评论进行处理或输出
%>
<div class="comment">
    <h3><%=p.getName() %></h3>
    <p><%=p.getContent() %></p>
</div>
<%
        }
    }
%>

<form action="/pinglun" onsubmit="return check()">
    <input type="hidden" name="method" value="add"/>
    <textarea placeholder="请输入您的评论" name="content" id="content"></textarea><br>
    <input type="submit" onclick="pinglun()" value="发表评论">
</form>
<script>
    function check() {
        var content=document.getElementById("content").value;
        if(content==null||content==""){
            alert("评论不能为空");
            return false;
        }
        return true;
    }


</script>
</body>
</html>
